home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / likene1a / myprog10.frm (.txt) < prev    next >
Visual Basic Form  |  1999-09-24  |  5KB  |  157 lines

  1. VERSION 5.00
  2. Begin VB.Form frmmain 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Miscellaneous"
  5.    ClientHeight    =   1080
  6.    ClientLeft      =   4515
  7.    ClientTop       =   3615
  8.    ClientWidth     =   3120
  9.    ControlBox      =   0   'False
  10.    BeginProperty Font 
  11.       Name            =   "MS Sans Serif"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   700
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    LinkTopic       =   "Form5"
  20.    MaxButton       =   0   'False
  21.    MinButton       =   0   'False
  22.    ScaleHeight     =   1080
  23.    ScaleWidth      =   3120
  24.    ShowInTaskbar   =   0   'False
  25.    Begin VB.CommandButton Command1 
  26.       Caption         =   "Play sound"
  27.       Height          =   375
  28.       Left            =   1560
  29.       TabIndex        =   5
  30.       Top             =   720
  31.       Width           =   1575
  32.    End
  33.    Begin VB.CommandButton Command8 
  34.       Caption         =   "Msg manager"
  35.       Height          =   375
  36.       Left            =   0
  37.       TabIndex        =   3
  38.       Top             =   720
  39.       Width           =   1575
  40.    End
  41.    Begin VB.CommandButton command10 
  42.       BackColor       =   &H00C0C0C0&
  43.       Caption         =   "Play CD"
  44.       Height          =   375
  45.       Left            =   1560
  46.       TabIndex        =   2
  47.       Top             =   360
  48.       Width           =   1575
  49.    End
  50.    Begin VB.CommandButton Command5 
  51.       BackColor       =   &H00C0C0C0&
  52.       Caption         =   "Show image"
  53.       Height          =   375
  54.       Left            =   0
  55.       TabIndex        =   1
  56.       Top             =   360
  57.       Width           =   1575
  58.    End
  59.    Begin VB.CommandButton Command4 
  60.       BackColor       =   &H00C0C0C0&
  61.       Caption         =   "Open CD-ROM"
  62.       Height          =   375
  63.       Left            =   1560
  64.       TabIndex        =   0
  65.       Top             =   0
  66.       Width           =   1575
  67.    End
  68.    Begin VB.CommandButton Command25 
  69.       Caption         =   "Exit"
  70.       Height          =   375
  71.       Left            =   0
  72.       TabIndex        =   4
  73.       Top             =   0
  74.       Width           =   1575
  75.    End
  76. Attribute VB_Name = "frmmain"
  77. Attribute VB_GlobalNameSpace = False
  78. Attribute VB_Creatable = False
  79. Attribute VB_PredeclaredId = True
  80. Attribute VB_Exposed = False
  81. Dim mmflag As Boolean
  82. Dim sax As Integer
  83. Dim Say As Integer
  84. Private Declare Function mciSendString Lib "winmm.dll" Alias _
  85. "mciSendStringA" (ByVal lpstrCommand As String, ByVal _
  86. lpstrReturnString As String, ByVal uReturnLength As Long, _
  87. ByVal hwndCallback As Long) As Long
  88. Private Type RECT
  89.     Left As Long
  90.     Top As Long
  91.     Right As Long
  92.     Bottom As Long
  93. End Type
  94. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
  95.    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  96.  Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, _
  97.    ByVal nCmdShow As Long) As Long
  98.  Private Const SW_HIDE = 0
  99.  Private Const SW_SHOWNORMAL = 1
  100. Private Sub Command1_Click()
  101. Form7.Show
  102. End Sub
  103. Private Sub command10_Click()
  104. PopupMenu Frmmenu.mnuFile, 0, frmmain.ScaleWidth / 2, frmmain.ScaleHeight / 2
  105. End Sub
  106. Private Sub Command25_Click()
  107.     Call ImplodeForm(Me, 2, 500, 1)
  108.     Unload frmmain
  109.     Form12.Show
  110. End Sub
  111. Private Sub Command4_Click()
  112. If Command4.Caption = "Open CD-ROM" Then
  113. Command4.Caption = "Close CD-ROM"
  114. Command4.Caption = "Open CD-ROM"
  115. End If
  116. If Command4.Caption = "Close CD-ROM" Then
  117. retvalue = mciSendString("set CDAudio door open", _
  118. returnstring, 127, 0)
  119. End If
  120. If Command4.Caption = "Open CD-ROM" Then
  121. retvalue = mciSendString("set CDAudio door closed", _
  122. returnstring, 127, 0)
  123. End If
  124. End Sub
  125. Private Sub Command5_Click()
  126. MsgBox "Only open .bmp files ok?", 64 + 0, "Info"
  127. Form8.Show
  128. End Sub
  129. Private Sub Command8_Click()
  130. Load Form3
  131. Form3.Show
  132. End Sub
  133. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  134.    Dim fml As Long
  135.    Dim fmt As Long
  136.    Dim a As Integer
  137.    If mmflag = True Then
  138.       fml = Me.Left: fmt = Me.Top
  139.       If X > sax Then Me.Left = fml + (X - sax)
  140.         If X < sax Then Me.Left = fml - (sax - X)
  141.       If Y > Say Then Me.Top = fmt + (Y - Say)
  142.       If Y < Say Then Me.Top = fmt - (Say - Y)
  143.    End If
  144.    End Sub
  145. Private Sub form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  146. If mmflag = False Then
  147.       sax = X
  148.       Say = Y
  149.       mmflag = True
  150.    End If
  151.    Me.MousePointer = vbSizePointer
  152.    End Sub
  153. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  154.     mmflag = False
  155.    Me.MousePointer = vbDefault
  156. End Sub
  157.